<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>预定义常量</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="dom.resources.html">资源类型</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="dom.examples.html">范例</a></div>
 <div class="up"><a href="book.dom.html">DOM</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="dom.constants" class="chapter">
 <h1>预定义常量</h1>

 <p class="simpara">下列常量由此扩展定义，且仅在此扩展编译入 PHP 或在运行时动态载入时可用。</p>
  <table class="doctable table">
   <caption><strong>XML constants</strong></caption>
   
    <thead>
     <tr>
      <th>Constant</th>
      <th>Value</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr id="constant.xml-element-node">
      <td>
       <strong><code>XML_ELEMENT_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>1</td>
      <td>Node is a <a href="class.domelement.html" class="classname">DOMElement</a></td>
     </tr>

     <tr id="constant.xml-attribute-node">
      <td>
       <strong><code>XML_ATTRIBUTE_NODE</code></strong> 
      (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>2</td>
      <td>Node is a <a href="class.domattr.html" class="classname">DOMAttr</a></td>
     </tr>

     <tr id="constant.xml-text-node">
      <td>
       <strong><code>XML_TEXT_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>3</td>
      <td>Node is a <a href="class.domtext.html" class="classname">DOMText</a></td>
     </tr>

     <tr id="constant.xml-cdata-section-node">
      <td>
       <strong><code>XML_CDATA_SECTION_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>4</td>
      <td>Node is a <a href="class.domcharacterdata.html" class="classname">DOMCharacterData</a></td>
     </tr>

     <tr id="constant.xml-entity-ref-node">
      <td>
       <strong><code>XML_ENTITY_REF_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>5</td>
      <td>Node is a <a href="class.domentityreference.html" class="classname">DOMEntityReference</a></td>
     </tr>

     <tr id="constant.xml-entity-node">
      <td>
       <strong><code>XML_ENTITY_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>6</td>
      <td>Node is a <a href="class.domentity.html" class="classname">DOMEntity</a></td>
     </tr>

     <tr id="constant.xml-pi-node">
      <td>
       <strong><code>XML_PI_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>7</td>
      <td>Node is a <a href="class.domprocessinginstruction.html" class="classname">DOMProcessingInstruction</a></td>
     </tr>

     <tr id="constant.xml-comment-node">
      <td>
       <strong><code>XML_COMMENT_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>8</td>
      <td>Node is a <a href="class.domcomment.html" class="classname">DOMComment</a></td>
     </tr>

     <tr id="constant.xml-document-node">
      <td>
       <strong><code>XML_DOCUMENT_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>9</td>
      <td>Node is a <a href="class.domdocument.html" class="classname">DOMDocument</a></td>
     </tr>

     <tr id="constant.xml-document-type-node">
      <td>
       <strong><code>XML_DOCUMENT_TYPE_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>10</td>
      <td>Node is a <a href="class.domdocumenttype.html" class="classname">DOMDocumentType</a></td>
     </tr>

     <tr id="constant.xml-document-frag-node">
      <td>
       <strong><code>XML_DOCUMENT_FRAG_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>11</td>
      <td>Node is a <a href="class.domdocumentfragment.html" class="classname">DOMDocumentFragment</a></td>
     </tr>

     <tr id="constant.xml-notation-node">
      <td>
       <strong><code>XML_NOTATION_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>12</td>
      <td>Node is a <a href="class.domnotation.html" class="classname">DOMNotation</a></td>
     </tr>

     <tr id="constant.xml-html-document-node">
      <td>
       <strong><code>XML_HTML_DOCUMENT_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>13</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-dtd-node">
      <td>
       <strong><code>XML_DTD_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>14</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-element-decl-node">
      <td>
       <strong><code>XML_ELEMENT_DECL_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>15</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-attribute-decl-node">
      <td>
       <strong><code>XML_ATTRIBUTE_DECL_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>16</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-entity-decl-node">
      <td>
       <strong><code>XML_ENTITY_DECL_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>17</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-namespace-decl-node">
      <td>
       <strong><code>XML_NAMESPACE_DECL_NODE</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>18</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-attribute-cdata">
      <td>
       <strong><code>XML_ATTRIBUTE_CDATA</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>1</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-attribute-id">
      <td>
       <strong><code>XML_ATTRIBUTE_ID</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>2</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-attribute-idref">
      <td>
       <strong><code>XML_ATTRIBUTE_IDREF</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>3</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-attribute-idrefs">
      <td>
       <strong><code>XML_ATTRIBUTE_IDREFS</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>4</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-attribute-entity">
      <td>
       <strong><code>XML_ATTRIBUTE_ENTITY</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>5</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-attribute-nmtoken">
      <td>
       <strong><code>XML_ATTRIBUTE_NMTOKEN</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>7</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-attribute-nmtokens">
      <td>
       <strong><code>XML_ATTRIBUTE_NMTOKENS</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>8</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-attribute-enumeration">
      <td>
       <strong><code>XML_ATTRIBUTE_ENUMERATION</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>9</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr id="constant.xml-attribute-notation">
      <td>
       <strong><code>XML_ATTRIBUTE_NOTATION</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>10</td>
      <td class="empty">&nbsp;</td>
     </tr>

    </tbody>
   
  </table>

  <table class="doctable table">
   <caption><strong>DOMException constants</strong></caption>
   
    <thead>
     <tr>
      <th>Constant</th>
      <th>Value</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr id="constant.dom-php-err">
      <td>
       <strong><code>DOM_PHP_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>0</td>
      <td>
       Error code not part of the DOM specification. Meant for PHP errors.
      </td>
     </tr>

     <tr id="constant.dom-index-size-err">
      <td>
       <strong><code>DOM_INDEX_SIZE_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>1</td>
      <td>
       If index or size is negative, or greater than the allowed value.
      </td>
     </tr>

     <tr id="constant.domstring-size-err">
      <td>
       <strong><code>DOMSTRING_SIZE_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>2</td>
      <td>
       If the specified range of text does not fit into a 
       <strong class="classname">DOMString</strong>.
      </td>
     </tr>

     <tr id="constant.dom-hierarchy-request-err">
      <td>
       <strong><code>DOM_HIERARCHY_REQUEST_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>3</td>
      <td>If any node is inserted somewhere it doesn&#039;t belong</td>
     </tr>

     <tr id="constant.dom-wrong-document-err">
      <td>
       <strong><code>DOM_WRONG_DOCUMENT_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>4</td>
      <td>
       If a node is used in a different document than the one that created it.
      </td>
     </tr>

     <tr id="constant.dom-invalid-character-err">
      <td>
       <strong><code>DOM_INVALID_CHARACTER_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>5</td>
      <td>
       If an invalid or illegal character is specified, such as in a name.
      </td>
     </tr>

     <tr id="constant.dom-no-data-allowed-err">
      <td>
       <strong><code>DOM_NO_DATA_ALLOWED_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>6</td>
      <td>
       If data is specified for a node which does not support data.
      </td>
     </tr>

     <tr id="constant.dom-no-modification-allowed-err">
      <td>
       <strong><code>DOM_NO_MODIFICATION_ALLOWED_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>7</td>
      <td>
       If an attempt is made to modify an object where modifications are not allowed.
      </td>
     </tr>

     <tr id="constant.dom-not-found-err">
      <td>
       <strong><code>DOM_NOT_FOUND_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>8</td>
      <td>
       If an attempt is made to reference a node in a context where it does not exist.
      </td>
     </tr>

     <tr id="constant.dom-not-supported-err">
      <td>
       <strong><code>DOM_NOT_SUPPORTED_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>9</td>
      <td>
       If the implementation does not support the requested type of object or operation.
      </td>
     </tr>

     <tr id="constant.dom-inuse-attribute-err">
      <td>
       <strong><code>DOM_INUSE_ATTRIBUTE_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>10</td>
      <td>
       If an attempt is made to add an attribute that is already in use elsewhere.
      </td>
     </tr>

     <tr id="constant.dom-invalid-state-err">
      <td>
       <strong><code>DOM_INVALID_STATE_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>11</td>
      <td>
       If an attempt is made to use an object that is not, or is no longer, usable.
      </td>
     </tr>

     <tr id="constant.dom-syntax-err">
      <td>
       <strong><code>DOM_SYNTAX_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>12</td>
      <td>If an invalid or illegal string is specified.</td>
     </tr>

     <tr id="constant.dom-invalid-modification-err">
      <td>
       <strong><code>DOM_INVALID_MODIFICATION_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>13</td>
      <td>If an attempt is made to modify the type of the underlying object.</td>
     </tr>

     <tr id="constant.dom-namespace-err">
      <td>
       <strong><code>DOM_NAMESPACE_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>14</td>
      <td>
       If an attempt is made to create or change an object in a way which is 
       incorrect with regard to namespaces.
      </td>
     </tr>

     <tr id="constant.dom-invalid-access-err">
      <td>
       <strong><code>DOM_INVALID_ACCESS_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>15</td>
      <td>
       If a parameter or an operation is not supported by the underlying object.
      </td>
     </tr>

     <tr id="constant.dom-validation-err">
      <td>
       <strong><code>DOM_VALIDATION_ERR</code></strong>
       (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
      </td>
      <td>16</td>
      <td>
       If a call to a method such as insertBefore or removeChild would make the Node
       invalid with respect to &quot;partial validity&quot;, this exception would be raised and 
       the operation would not be done.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="dom.resources.html">资源类型</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="dom.examples.html">范例</a></div>
 <div class="up"><a href="book.dom.html">DOM</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
